package com.pureland.boot.web;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 * @projectName: pureland_cloud
 * @className: com.pureland.boot.config.log.WebLogAutoConfiguration
 * @description: WebLog自动配置类,启动条件:存在web环境. 该切面实现是同步阻塞的，生产环境慎用,仅供开发测试环境调试使用
 * @author: tong.li
 * @createTime: 2020/10/12 11:04
 * @version: v1.0
 * @copyright: 版权所有 李彤 © 2020
 */
@Configuration
@ConditionalOnWebApplication
@ConditionalOnProperty(prefix  = "pureland.web.log", value = "enabled",  matchIfMissing = false)
public class WebLogAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(WebLogAspect.class)
    public WebLogAspect webLogAspect() {
        return new WebLogAspect();
    }

}
